package com.huawei.secure.android.common.detect;

import android.securitydiagnose.HwSecurityDiagnoseManager;
import android.securitydiagnose.HwSecurityDiagnoseManager.StpExtraStatusInfo;
import android.util.Log;
import com.huawei.android.os.BuildEx.VERSION;
import com.huawei.android.util.NoExtAPIException;

public abstract class b {
    private static final String TAG = "Emui10RootDetect";
    private static final int f = 8;
    private static final int g = 1;

    static boolean isRoot() {
        try {
            if (VERSION.EMUI_SDK_INT >= 21) {
                if (1 == HwSecurityDiagnoseManager.getInstance().getStpStatusByCategory(8, false, false, new StpExtraStatusInfo())) {
                    return true;
                }
                return false;
            }
            Log.i(TAG, "OS is lower than Emui 10.");
            return false;
        } catch (NoExtAPIException e) {
            Log.w(TAG, "NoExtAPIException : " + e.getMessage());
        } catch (NoClassDefFoundError e2) {
            Log.w(TAG, "NoClassDefFoundError : " + e2.getMessage());
        }
    }
}
